import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  isLogin = false;
  loginClick() {
    if (this.isLogin) {
      this.isLogin = false;
      window.localStorage.setItem('login', JSON.stringify(false));
    } else {
      this.isLogin = true;
      window.localStorage.setItem('login', JSON.stringify(true));
    }
  }
  ngOnInit() {
    const login = window.localStorage.getItem('login') 
    if (login) {
      this.isLogin = JSON.parse(login)
    }
  }
}
